package com.sorhis.controller;

import com.sorhis.dto.LoginDTO;
import com.sorhis.service.LoginService;
import com.sorhis.vo.ResultVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author xihao.ding
 * @Date 2023/3/17 16:40
 * @Description: TODO
 */
@RestController
@RequestMapping("/system/v1")
@RequiredArgsConstructor
public class LoginController {

    private final LoginService loginService;


    @GetMapping("/")
    public String test(){
        return "启动成功";
    }

    @PostMapping("/login")
    public ResultVO login(@RequestBody LoginDTO loginDTO) throws Exception{
        return loginService.login(loginDTO);
    }


}
